<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <link rel="stylesheet" href="./css/base.css">
  <link rel="stylesheet" href="./css/amap.css">
  <link rel="stylesheet" href="https://style.feijiu.net/css/shichang/scbase.css">
  <link rel="stylesheet" href="https://style.feijiu.net/css/shichang/scindex.css">
  <script src="./js/jquery-3.7.1.js"></script>
  <script src="https://webapi.amap.com/loader.js"></script>
  <script src="./js/amap.js"></script>
</head>

<body>
  <div class="container">
    <div class="menuContainer" id="menuContainer">
      <a href="javascript:void(0);" onclick="getMenu('水果市场')" title="水果市场">水果市场</a>
    </div>
    <div class="mapContainer" id="mapContainer"></div>
  </div>

  <script type="text/javascript">
    window._AMapSecurityConfig = {
      securityJsCode: "「你申请的安全密钥」",
    };
  </script>
  <script type="text/javascript" src="https://webapi.amap.com/maps?v=2.0&key=替换为你申请的 key"></script>

  <!-- 加载高德地图 -->
  <script type="text/javascript">
    initialize()

    $(document).ready(function () {
      $ajax('getProvinceClass', drawMapText)
    });
  </script>
  <!-- 封装ajax方法 -->
  <script type="text/javascript">
    const $ajax = (url, cb) => {
      $.ajax({
        url: `./data/${url}.json`,
        type: 'GET',
        dataType: 'json',
        success: function (data) {
          cb && cb(data)
        },
        error: function (xhr, status, error) {
          console.error("Error loading JSON file: " + error);
        }
      });
    }
  </script>
</body>

</html>